package com.jeesite.modules.stock.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jeesite.modules.stock.dto.vo.ChartLineDataVO;
import com.jeesite.modules.stock.service.StockFinaceChartService;

@RestController
@RequestMapping("${adminPath}/finace/chart")
public class StockFininaceController {

	@Autowired
	StockFinaceChartService stockFinaceChartService;
	/**
	 * 获取股票利润率折线图数据(同比和环比)
	 * @return
	 */
	@GetMapping("getNetProfitDatas/{stockCode}")
	public List<ChartLineDataVO> getNetProfitDatas(@PathVariable String stockCode) {
		return stockFinaceChartService.queryNetProfitList(stockCode);
	}
	
	/**
	 * 获取股票营收增长率折线图数据(同比和环比)
	 * @return
	 */
	@GetMapping("getRevenueDatas/{stockCode}")
	public List<ChartLineDataVO> getRevenueDatas(@PathVariable String stockCode) {
		return stockFinaceChartService.queryRenevueList(stockCode);
	}
	
	/**
	 * 利润率变化
	 * @param stockCode
	 * @return
	 */
	@GetMapping("getGrossProfit/{stockCode}")
	public List<ChartLineDataVO> getGrossProfit(@PathVariable String stockCode) {
		return stockFinaceChartService.queryGrossProfit(stockCode);
	}
}
